#ifndef GAME_H
#define GAME_H

#include <QMainWindow>
#include <QWidget>
#include <QTimer>
#include <QLabel>
#include <QVector>
#include <grid.h>

class game : public QMainWindow
{
    Q_OBJECT
public:

    int dx[8] = {1,1,1,-1,-1,-1,0,0};
    int dy[8] = {1,0,-1,1,0,-1,1,-1};  
    int len;
    int wid;
    int num;
    int now_num = 0;
    int time_spent = 0;
    bool start_timer;
    QLabel * now_time = NULL;
    grid * minemap[40][40];
    void dfs(int x,int y);
    bool isWin();
    bool infield(int x,int y);
    void clickall(int x,int y,int num);
    explicit game(QWidget *parent = nullptr,int length = 0,int width = 0,int num = 0);
    void timerEvent(QTimerEvent *);
signals:
public slots:
};

#endif // GAME_H
